From c446fe9590b0a4c5d1442651453b28685ad93239 Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 14 Jan 2026 06:34:44 +0100
Subject: feat: a lot of shit

---
 src/routes/blog/[id=int]/+page.svelte | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

(limited to 'src/routes/blog/[id=int]/+page.svelte')

diff --git a/src/routes/blog/[id=int]/+page.svelte b/src/routes/blog/[id=int]/+page.svelte
index 16fc586..b2f6807 100644
--- a/src/routes/blog/[id=int]/+page.svelte
+++ b/src/routes/blog/[id=int]/+page.svelte
@@ -10,19 +10,22 @@
 
   let { data }: PageProps = $props();
 
+  let route = $derived(
+    forceTrailingSlash(
+      resolve('/blog/[id=int]-[slug]', {
+        id: data.post.metadata.id.toString(),
+        slug: data.post.metadata.slug,
+      }),
+    ),
+  );
+
   onMount(() => {
-    tick().then(() =>
-      replaceState(
-        forceTrailingSlash(
-          resolve('/blog/[id=int]-[slug]', {
-            id: data.post.metadata.id.toString(),
-            slug: data.post.metadata.slug,
-          }),
-        ),
-        page.state,
-      ),
-    );
+    tick().then(() => replaceState(route, page.state));
   });
 </script>
 
+<svelte:head>
+  <link rel="canonical" href={new URL(route, page.url).href} />
+</svelte:head>
+
 <Post post={data.post} />
-- 
cgit v1.2.3

